home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_casm / snpd9611.zip / DBL2LONG.C < prev    next >
Text File  |  1996-11-24  |  751b  |  19 lines

  1. .I 0 3
  2. /* +++Date last modified: 08-Nov-1995 */
  3.  
  4. /*
  5. .D 1 1
  6. .I 76 11
  7. the number should be rounded to the nearest representable value.  If the
  8. compiler does not support extended math funtionality, a compile-time error is
  9. generated if FLT_ROUNDS isn't set to 1, i.e. if not rounding to the nearest
  10. representable value.  The addition of 2.0*(LONG_MAX+1.0) for the signed long
  11. is to prevent the MSB of the mantissa being borrowed for negative inputs - if
  12. this happened, the exponent would change and the LSB of the mantissa would no
  13. longer be worth 1.  This offset would be perfectly okay to use with the
  14. unsigned longs too but it's unnecessary for them, unless you want to get the
  15. answer correct modulo 2^^32 for negatives.
  16.  
  17. */
  18. .D 77 13
  19.